package top.zhangjianyong.tools.service.mybatis.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.zhangjianyong.tools.entity.poet.Poet;
import top.zhangjianyong.tools.mapper.PoetMapper;
import top.zhangjianyong.tools.service.mybatis.IPoetService;

/**
 * @author ： zhangjianyong
 * @date ： 2023/1/19 10:41 AM
 */
@Service
public class IPoetServiceImpl extends ServiceImpl<PoetMapper, Poet> implements IPoetService {

    @Override
    public boolean existByUuid(Poet poet) {
        return lambdaQuery().eq(Poet::getUuid, poet.getUuid()).count() > 0;
    }

    @Override
    public boolean existByParagraphs(Poet poet) {
        return lambdaQuery().eq(Poet::getParagraphs, poet.getParagraphs()).count() > 0;
    }
}
